#ifndef GameWorld_h
#define GameWorld_h
#include <time.h>
#include "ViewPort.h"
#include <d3dx9.h>
#include "Sprite.h"
#include "Game.h"
#include "Mario.h"
#include "QuadTree.h"
#include "ResourceManager.h"
#include "Font.h"
#include "Score.h"
#include <fstream>
using namespace std;

#define COLLISION_SIZE 500

class GameWorld: public Game
{
public: 

	GameWorld();
	GameWorld(HINSTANCE hInstance, int FrameRate);
	~GameWorld();

private:
	LPDIRECT3DSURFACE9 Background;
	ViewPort *viewport;
	QuadTree *quadTree;
	ResourceManager *resourceManager;
	Mario *mario;
	Font* font;
	//start checking collision when finish rendering
	boolean startCheckingColli;

	void InitGameWorld();
	void RenderFrame(LPDIRECT3DDEVICE9 d3ddvint);
	void ProcessInput(LPDIRECT3DDEVICE9 d3ddv);
	void LoadResources(LPDIRECT3DDEVICE9 d3ddv);
	void Update(int Delta);
	void OnKeyDown(int KeyCode);
};


#endif